home *** CD-ROM | disk | FTP | other *** search
/ Info-Mac 4 / Info_Mac IV CD-ROM (Pacific HiTech Inc.)(August 1994).iso / Graphics / Utilities / MooVer 1.0 ƒ / MooVerDemo.POV < prev   
Text File  |  1994-03-27  |  4KB  |  170 lines

  1. // Persistence of Vision 2 scene file
  2. // ------------------------------------------------------------
  3. // File: MooVerDemo.POV
  4. // Desc:
  5. //   This file creates a simple animation sequence of
  6. //   PICT images via POV-Ray.  These images can then
  7. //   be dropped onto MooVer to create a QuickTime movie.
  8. // Author: Eduard [esp] Schwan
  9. // ------------------------------------------------------------
  10. //
  11.  
  12.  
  13. /*
  14. ---------------------------------------------------------------
  15. Grab a bunch of useful color definitions.  This will
  16. also insure you have your INCLUDE folder path set up
  17. properly in the Application Preferences dialog.
  18. */
  19.  
  20. #include "colors.inc"
  21.  
  22.  
  23. /*
  24. ---------------------------------------------------------------
  25. Indirectly declaring a clock variable might seem odd at first,
  26. why not just sprinkle "clock" expressions all over the scene file?
  27. Because, you can easily substitute a single value in the following
  28. declare statement in place of clock, and you can then immediately
  29. render any single frame you wish.  It just adds a single point of
  30. entry for the animation stuff.  I also usually assume that the
  31. clock value always goes from 0.0 to 1.0, and then create my
  32. expressions down in the code where appropriate to rescale the range.
  33. */
  34.  
  35. #declare Animate_Value = clock // 0.0 to 1.0
  36.  
  37. #declare Torus_Rot = 180 // total degrees to rotate whole object
  38. #declare Ball_Rot = 180 // total degrees to rotate each ball
  39.  
  40. // ---- camera ----
  41.  
  42. camera
  43. {
  44.   direction 2*z
  45.   location <0, 1.5, -4>
  46. //  right 4/3*x // use this if scene is not square (MxN instead of MxM)
  47.   look_at 0*y
  48. }
  49.  
  50. // ---- sun ----
  51.  
  52. light_source
  53. {
  54.   0*x color White
  55.   looks_like { box {<-1,-2,-1> <1,2,1> pigment{color Yellow}} }
  56.   translate <20,10,-10>
  57. }
  58.  
  59. // ---- sky ----
  60.  
  61. // use the following for a busy and interesting sky...
  62. sphere
  63. {
  64.   0*x, 1.0
  65.   texture
  66.   {
  67.     pigment
  68.     {
  69.       marble rotate 90*z // almost like a Y gradient, not quite :-)
  70.       turbulence <1,0.5,0.5>
  71.       scale 0.5
  72.       color_map
  73.       {
  74.         [0.1  color blue 0.2]
  75.         [0.5  color blue 0.8]
  76.         [0.6  color blue 1 red 0.5]
  77.         [0.7  color red 0.5 green 0.5 blue 0.5]
  78.         [1.0  color White]
  79.       }
  80.     } // -pigment
  81.     finish { ambient 1 diffuse 0 }
  82.   } // -texture
  83.   scale 50
  84. }
  85.  
  86.  
  87. // ---- object ----
  88.  
  89. // the agate marbles
  90. #declare SphereTexture = texture
  91. {
  92.   pigment { agate scale 0.3 }
  93.   finish { reflection 0.1 specular 0.3 }
  94. }
  95.  
  96. // wooden torus dimensions
  97. #declare MajorRad = 0.7
  98. #declare MinorRad = 0.3
  99.  
  100. union
  101. {
  102.   intersection // #1
  103.   {
  104.  
  105.     // wooden torus
  106.     torus
  107.     {
  108.       MajorRad, MinorRad
  109.       scale <1,0.5,1> // squish it a little flat
  110.       texture
  111.       {
  112.         pigment{wood translate 4*x turbulence 0.2 scale 0.15}
  113.         finish{specular 0.4 roughness 0.05}
  114.       }
  115.     } // -torus
  116.  
  117.     // cut out slits for balls to fit in
  118.     box
  119.     {
  120.       -(x+y+z), x+y+z
  121.       scale <MinorRad,1.1,1.1>
  122.       inverse
  123.     } // -box
  124.   } // -intersection #1
  125.  
  126.   // plug up the holes with a couple of spheres
  127.   // Each ball is rotating slowly in place as it is orbiting.
  128.   // By the time of a 1/2 orbit, the 2nd ball will have rotated
  129.   // its texture over to match the 1st balls original texture
  130.   // position, making a looped movie smoother looking.
  131.   // Hopefully nobody will notice the woodgrain shift.
  132.   sphere
  133.   { 0*x, MinorRad
  134.     texture {SphereTexture} rotate Animate_Value*Ball_Rot*x translate -MajorRad*z
  135.   }
  136.   sphere
  137.   { 0*x, MinorRad
  138.     texture {SphereTexture} rotate -Animate_Value*Ball_Rot*x translate +MajorRad*z
  139.   }
  140.  
  141.   // fill the hole with an apple core
  142.   intersection // #2
  143.   {
  144.     // the hole/inside of a torus (inversed)
  145.     torus
  146.     {
  147.       1.3, 1.1
  148.       inverse
  149.       texture
  150.       {
  151.         pigment { color green 1 }
  152.         normal { bumps 0.3 scale 0.1 }
  153.         finish { reflection 0.5 specular 0.3 metallic }
  154.       }
  155.     } // -torus
  156.     // clipped by a sphere
  157.     sphere
  158.     {
  159.       0*x, 0.9 // SphereRad < TorusMajorRad!
  160.       pigment { color red 1 }
  161.     }
  162.   } // -intersection #2
  163.  
  164.   // Here's the main magic...
  165.   // rotate this whole toroid ensemble around the Y axis
  166.   rotate Animate_Value*Torus_Rot*y
  167.  
  168. } // -union
  169.  
  170.